import request from '@/utils/request.js'


//删除购物车
export const deleteCartService = (id) => {
    return request.delete('/cart/delete?id=' + id)
}

//根据用户id获取购物车列表
export const getCartListService = (params) => {
   return request.get('/cart/findByUserId', { params })
}

//更新购物车
export const updateCartService = (data) => {
   return request.put('/cart/update', data)
   
}
//批量删除
export const batchDeleteCartService = (ids) => {
   return request.delete('/cart/delete/batch',{data:ids})
}
//分页查询
export const CartListService = (params) => {
   return request.get('/cart/selectPage', { params })
}
// 添加订单
export const addOrderService = (data) => {
   return request.post('/Order/create', data);
}